(function($) {
	$('.js-form-file').on('change', function() {
      	var fileNames = '';
      	$.each(this.files, function() {
        	fileNames += '<span class="badge">' + this.name + '</span> ';
      	});
      $(this).closest('.form-file').next('.file-list').html(fileNames);
    });

    /**
     * 牛人审核个人资料编辑
     */
    if( $('#introduction').length ) {
	    tinymce.init({
	        selector: "#introduction",
	        theme: 'modern',
			menubar: false,
			language : 'zh_CN',
			plugins: ['textcolor', 'anchor', 'charmap', 'hr', 'link', 'fullscreen'],
			toolbar: [
				"undo redo | styleselect | forecolor bold italic bullist numlist | alignleft aligncenter alignright | charmap hr link | fullscreen"
			],
			theme_advanced_buttons3_add : "fullscreen",
	        fullscreen_new_window : false,
	        fullscreen_settings : {
	                theme_advanced_path_location : "top"
	        }
	    });
	}

	if( $('#relatedLinks').length ) {
		tinymce.init({
	        selector: "#relatedLinks",
	        theme: 'modern',
			menubar: false,
			language : 'zh_CN',
			plugins: ['textcolor', 'anchor', 'charmap', 'hr', 'link', 'fullscreen'],
			toolbar: [
				"undo redo | styleselect | forecolor bold italic bullist numlist | alignleft aligncenter alignright | charmap hr link | fullscreen"
			],
			theme_advanced_buttons3_add : "fullscreen",
	        fullscreen_new_window : false,
	        fullscreen_settings : {
	                theme_advanced_path_location : "top"
	        }
	    });
	}


})(jQuery);